class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def speak(self):
        print(f'大家好，我叫{self.name}，我今年：{self.age}岁。')


# Student 继承Person
class Student(Person):
    def __init__(self, name, age, score):
        super().__init__(name, age)  # 调用父类的初始化方法
        self.score = score


# 医生类
class Doctor(Person):
    # 编写初始化方法
    def __init__(self, name, age, department):
        super().__init__(name, age)
        self.department = department


if __name__ == '__main__':
    stu = Student('马迪迪', 22, 89.1)
    stu.speak()
    doctor = Doctor('刘医生', 34, '牛子科')
    doctor.speak()
